import { NavLink } from "react-router-dom"

const listData = [
  { path: '/arrayToTree', name: '将平铺的数据整合成tree' },
  { path: '/flatten', name: '数组的扁平化' },
  { path: '/clearRepeat', name: '数组去重' },
  { path: '/bubbleSort', name: '冒泡排序' },
  { path: '/mergeArray', name: '合并两个有序的数组，按递增的顺序排列' },
  { path: '/findTarget', name: '在数组中找出和为目标值的两个数' },
  { path: '/findCondition', name: '给你一个包含n个整数的数组 nums，判断是否存在三个元素 a,b,c 使得 a + b + c = 0？' },
  { path: '/reversalArray', name: '在指定的次数里反转数组' },
  { path: '/findSymmetry', name: '找出1-10000中的对称数字' },
  { path: '/zeroToEnd', name: '把数组中的零放到末尾' },
  { path: '/antiShake', name: '手写防抖' },
  { path: '/throttle', name: '手写节流' },
  { path: '/deepCopy', name: '手写深拷贝' }
]

function NavList() {
  return (
    <ul>
      {listData.map(item =>
        <li key={item.path}>
          <NavLink to={item.path}>{ item.name }</NavLink>
        </li>
      )}
    </ul>
  )
}

export default NavList